#!/usr/bin/env python
#coding:utf-8


class BaseActionFilter(object):
    
    @staticmethod
    def FilterAttribute(func):
        def wrapper(*args, **kv):
            
            before = BaseActionFilter.BeforeAction()
            if before:
                return before
            result = func(*args, **kv)
            if result:
                return result
            after = BaseActionFilter.AfterAction()
            if after:
                return after
            raise Exception('无返回值')
        return wrapper
    
    
    @classmethod
    def Instance(cls):
        return cls()
    
    def BeforeAction(self):
        pass
    
    def AfterAction(self):
        pass
    
    